home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_xemacs.idb / usr / freeware / lib / xemacs-20.4 / lisp / games / NeXTify.el.z / NeXTify.el
Encoding:
Text File  |  1998-05-21  |  2.0 KB  |  60 lines

  1. ;;; NeXTify.el --- Character insertion variation
  2.  
  3. ;; Copyright status unknown
  4.  
  5. ;; Author: Jamie Zawinski <jwz@netscape.com>
  6. ;; Keywords: games
  7.  
  8. ;; This file is part of XEmacs.
  9.  
  10. ;; XEmacs is free software; you can redistribute it and/or modify it
  11. ;; under the terms of the GNU General Public License as published by
  12. ;; the Free Software Foundation; either version 2, or (at your option)
  13. ;; any later version.
  14.  
  15. ;; XEmacs is distributed in the hope that it will be useful, but
  16. ;; WITHOUT ANY WARRANTY; without even the implied warranty of
  17. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  18. ;; General Public License for more details.
  19.  
  20. ;; You should have received a copy of the GNU General Public License
  21. ;; along with XEmacs; see the file COPYING.  If not, write to the Free
  22. ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
  23. ;; 02111-1307, USA.
  24.  
  25. ;;; Synched up with: Not in FSF
  26.  
  27. ;;; Commentary:
  28.  
  29. ;;; Code:
  30.  
  31. (defun SeLF-insert-command (arg)
  32.   "Insert the character you TyPE.
  33. Whichever character you TyPE to run ThIS command is inserted."
  34.   (interactive "p")
  35.   (let ((p (point))
  36.     (case-fold-search nil))
  37.     (self-insert-command arg)
  38.     (save-excursion
  39.       (goto-char p)
  40.       (skip-chars-backward " \t\r\n")
  41.       (if (condition-case () (forward-char -4) (error t))
  42.       nil
  43.     (if (looking-at "\\<[A-Za-z][a-z][a-z][a-z][^A-Za-z]")
  44.         (progn
  45.           (insert (upcase (following-char))) (delete-char 1)
  46.           (forward-char 1)
  47.           (insert (upcase (following-char))) (delete-char 1)
  48.           (insert (upcase (following-char))) (delete-char 1)))))))
  49.  
  50. (define-key text-mode-map " " 'SeLF-insert-command)
  51. (define-key text-mode-map "," 'SeLF-insert-command)
  52. (define-key text-mode-map "." 'SeLF-insert-command)
  53. (define-key text-mode-map "!" 'SeLF-insert-command)
  54. (define-key text-mode-map "-" 'SeLF-insert-command)
  55. (define-key text-mode-map "_" 'SeLF-insert-command)
  56. (define-key text-mode-map ";" 'SeLF-insert-command)
  57. (define-key text-mode-map ":" 'SeLF-insert-command)
  58.  
  59. ;;; NeXTify.el ends here
  60.